package net.kelissa.divizor.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;


public class StatDivizor
{
  private List<StatCell> cellStats;
  private int step;

  public StatDivizor()
  {
    this.cellStats = new ArrayList<StatCell>();
  }

  public void addStat(StatCell stat)
  {
    this.cellStats.add(stat);
  }

  public double getFitness()
  {
    DescriptiveStatistics stats = new DescriptiveStatistics();
    for (StatCell statCell : cellStats)
    {
      stats.addValue(statCell.getTotalFitness());
    }
    return stats.getMean();
  }

  public List<StatCell> getCellStats()
  {
    return cellStats;
  }

  public void setCellStats(List<StatCell> cellStats)
  {
    this.cellStats = cellStats;
  }

  public int getStep()
  {
    return step;
  }

  public void setStep(int step)
  {
    this.step = step;
  }


}
